Skip to content

fix(web): condense inspector header and surface call picker on mobile#32364

Merged
dvargasfuertes merged 1 commit into
mainfrom
apollo/fix-inspector-mobile-layout
May 28, 2026
Merged

fix(web): condense inspector header and surface call picker on mobile#32364
dvargasfuertes merged 1 commit into
mainfrom
apollo/fix-inspector-mobile-layout

Conversation

@vellum-apollo-bot
Copy link
Copy Markdown
Contributor

Summary

The LLM Context Inspector was unusable on phone viewports — the header text wrapped awkwardly and there was no way to switch between LLM calls because the desktop <aside> rail was hidden with no fallback. Tabs past Compaction were also clipped past the right edge.

This PR makes the inspector responsive while keeping the desktop layout pixel-identical:

  • Header reflow on mobile. Wraps onto multiple rows via flex-wrap + CSS order-*: Back + Export stay on row 1, the title block drops to its own full-width row so it never squeezes. Title sizes down from text-title-medium to text-body-large-bold below md:. Desktop layout is unchanged.
  • Mobile call picker. New MobileCallSelector wraps CallRail in BottomSheet.Root with a full-width pill trigger above the TabBar (mounted via md:hidden). Trigger reads Call N of M so the current selection stays visible even when the sheet is closed, and CallRail gained an onSelect? prop so the sheet closes itself once the user picks a row (URL ?callId changes alone don't reset the sheet's local open state).
  • Scrollable TabBar on narrow screens. overflow-x-auto on the row + shrink-0 whitespace-nowrap per button means all seven tabs are reachable via horizontal scroll on mobile. Added role=tablist / role=tab / aria-selected while in there.

Before / After

The mobile screenshot showed:

  • "LLM Context Inspector" forced to two lines inside ~120px
  • "Scoped to one message · …" wrapping vertically character-by-character
  • "52 LLM cal…" call count truncated
  • No way to switch calls
  • Skills + Memory tabs clipped off-screen

After this PR, on <md:

  • Back + Export occupy a tidy first row
  • Title block gets the full viewport width with a clean two-line subtitle
  • A "Call N of M ▾" pill above the tabs opens a BottomSheet listing every call
  • TabBar scrolls horizontally so every tab is reachable

Tests

  • mobile-call-selector.test.tsx (new) — trigger label shapes for selected / no-selection / stale-id cases + accessible name.
  • inspect-page.test.tsx — added an assertion that the mobile pill mounts alongside the desktop aside in the loaded state.
  • All 56 existing inspector tests continue to pass.

AGENTS.md compliance

  • Followed apps/web/docs/CAPACITOR.md: the BottomSheet primitive already handles safe-area-inset-bottom (pb-[calc(16px+var(--safe-area-inset-bottom,...))]), so the iOS Capacitor shell renders the sheet correctly without extra inset code from this PR.
  • No new bespoke frontend state (apps/web/docs/CONVENTIONS.md / frontend-architecture rule feat: initialize Next.js app in /web directory #1): the only new state is the sheet's local open boolean. Selection state remains URL-driven (?callId).

The LLM Context Inspector was unusable on phone viewports:

- Header crammed Back / title / Export / call count on one row, so
  'LLM Context Inspector' wrapped to two lines inside ~120px and the
  ScopeSubtitle truncated vertically.
- The call-selection rail was '<aside className="hidden ... md:block">'
  with no mobile fallback, leaving users unable to pick a call.
- TabBar had no overflow handling, so the trailing Skills/Memory tabs
  were clipped past the right edge.

Fixes:

- Header wraps onto multiple rows below 'md:' via 'flex-wrap' + CSS
  'order-*': Back + Export stay in row 1, the title block drops to its
  own full-width row so it never squeezes. Desktop layout is unchanged.
  Title sizes down from text-title-medium to text-body-large-bold on
  mobile.
- New 'MobileCallSelector' wraps CallRail in a BottomSheet.Root with a
  full-width pill trigger above the TabBar (mounted via 'md:hidden').
  Trigger reads 'Call N of M' so the current selection stays visible
  even when the sheet is closed.
- 'CallRail' now accepts an 'onSelect?' callback so the mobile sheet
  can close itself after a row is tapped — URL '?callId' changes don't
  reset the sheet's local 'open' state.
- TabBar gains 'overflow-x-auto' + per-button 'shrink-0 whitespace-nowrap'
  so all seven tabs are reachable via horizontal scroll on narrow
  screens; added role=tablist/tab + aria-selected while in there.

Tests: new 'mobile-call-selector.test.tsx' covers trigger label
shapes (selected, no selection, stale id) and the accessible name.
'inspect-page.test.tsx' picks up an assertion that the mobile pill
mounts alongside the desktop aside.
@dvargasfuertes dvargasfuertes merged commit 12710b5 into main May 28, 2026
7 checks passed
@dvargasfuertes dvargasfuertes deleted the apollo/fix-inspector-mobile-layout branch May 28, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant